import Vue from 'vue';

Vue.directive('has', {
  inserted: function (el, binding, vnode) {
    let has = vnode.context.$framework.account.hasPermission(binding.value);
    if (has === false) {
      el.parentNode.removeChild(el);
    }
  }
});

Vue.directive('hasPermi', {
  inserted: function (el, binding, vnode) {
    let has = vnode.context.$framework.account.hasPermission(binding.value);
    if (has === false) {
      el.parentNode.removeChild(el);
    }
  }
});

Vue.directive('hasRole', {
  inserted: function (el, binding, vnode) {
    let has = vnode.context.$framework.account.hasRole(binding.value);
    if (has === false) {
      el.parentNode.removeChild(el);
    }
  }
});

export default {};
